package com.ys.utils.yinsheng;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class YsKuaiJieUtil {
    @Value("${ys.kj.seller.id}")
    private String sellerId;
    @Value("${ys.kj.seller.name}")
    private String sellerName;
    //商户签约的请求路径,建议配置在项目的配置文件里面
    @Value("${ys.kj.req.url}")
    private String reqUrl;
    @Value("${ys.df.req.url}")
    private String dfReqUrl;
    //客户端私钥证书路径: 证书是在入网流程中自己申请的
    @Value("${ys.kj.private.key.file.path}")
    private String privateKeyFilePath;
    //客户端私钥密钥: 私钥密钥在入网流程中自己申请私钥证书时填写的
    @Value("${ys.kj.private.key.pass}")
    private String privateKeyPassworde;
    //银盛公钥证书路径: 证书入网申请后随邮件发放
    @Value("${ys.kj.public.key.file.path}")
    private String publicKeyFilePath;
    //商户在银盛支付平台开设的用户号[商户号]:入网申请后发放
    @Value("${ys.kj.partner.id}")
    private String partnerId;
    //商户在银盛支付平台开设的快捷业务代码:入网申请后发放
    @Value("${ys.kj.business.code}")
    private String kjBusicessCode;
    //商户在银盛支付平台开设的代付业务代码:入网申请后发放
    @Value("${ys.df.business.code}")
    private String dfBusicessCode;

    private static String _sellerId;
    private static String _sellerName;
    private static String _reqUrl;
    private static String _dfReqUrl;
    private static String _privateKeyFilePath;
    private static String _privateKeyPassworde;
    private static String _publicKeyFilePath;
    private static String _partnerId;
    private static String _kjBusicessCode;
    private static String _dfBusicessCode;

    @PostConstruct
    void init(){
        _sellerId = this.sellerId;
        _sellerName = this.sellerName;
        _reqUrl = this.reqUrl;
        _dfReqUrl = this.dfReqUrl;
        _privateKeyFilePath = this.privateKeyFilePath;
        _privateKeyPassworde = this.privateKeyPassworde;
        _publicKeyFilePath = this.publicKeyFilePath;
        _partnerId = this.partnerId;
        _kjBusicessCode = this.kjBusicessCode;
        _dfBusicessCode = this.dfBusicessCode;
    }


    public static String getSellerId(){
        return _sellerId;
    }

    public static String getSellerName(){
        return _sellerName;
    }

    public static String getPartnerId(){
        return _partnerId;
    }

    public static String getKjBusicessCode(){return _kjBusicessCode;}

    public static String getDfBusicessCode(){return _dfBusicessCode;}
}
